# 生成测试报告
# 导包
import time
import unittest
from interfaceDatabase.scripts.test01_login import TestLoginAPI
from interfaceDatabase.tools.HTMLTestRunner import HTMLTestRunner
from interfaceDatabase.scripts.test02_login import TestLoginAPI2
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestLoginAPI))
suite.addTest(unittest.makeSuite(TestLoginAPI2))
# 指定报告路径
# report = app.BASE_DIR+"/report/report-{}.html".format(time.strftime("%Y%m%d-%H%M%S"))
report = "./report/report.html"
# 打开文件流
with open(report, "wb") as f:
    # 创建HTMLTestRunner执行器
    runner = HTMLTestRunner(f, title="接口测试报告")
    # 执行测试套件
    runner.run(suite)


